﻿DELETE [AmorCanino].[DBO].PetRelatedPictures;
DELETE [AmorCanino].[dbo].[Animals];
DELETE [AmorCanino].[dbo].[Communication];
DELETE [AmorCanino].[dbo].[Users];
DELETE [AmorCanino].[dbo].[Races];
DELETE [AmorCanino].[dbo].[Products];
DELETE [AmorCanino].[dbo].[ProductCategories];
GO

/*ADMIN TABLE DATA*/
Set Identity_Insert [AmorCanino].[dbo].[Users] On
INSERT INTO [AmorCanino].[dbo].[Users] ([UserId],[Name],[Email],[Password],[Privileges],[Visible]) VALUES (1,'Admin','admin','2836C8D47DD02CCC3B7BB2CFA85B66EBFAD01250A55E894D20AE744A819CE0DD','admin', 1)
INSERT INTO [AmorCanino].[dbo].[Users] ([UserId],[Name],[Email],[Password],[Privileges],[Visible]) VALUES (2,'User','User','2836C8D47DD02CCC3B7BB2CFA85B66EBFAD01250A55E894D20AE744A819CE0DD','', 1)
INSERT INTO [AmorCanino].[dbo].[Users] ([UserId],[Name],[Email],[Password],[Privileges],[Visible]) VALUES (3,'HiddenUser','HiddenUser','2836C8D47DD02CCC3B7BB2CFA85B66EBFAD01250A55E894D20AE744A819CE0DD','', 1)
Set Identity_Insert [AmorCanino].[dbo].[Users] Off
GO

/*COMMUNICATION TABLE DATA*/
INSERT INTO [AmorCanino].[dbo].[Communication] (OriginatorID, TargetID,TextMessage, ReadedByOriginator, ReadedByTarget) VALUES (1,2,'{"Messages":[{"Message":"Prueba de mensaje", "UserId":"1", "PublishedDate":"/Date(1224043200000)/"}, {"Message":"Respuesta", "UserId":"2", "PublishedDate":"/Date(1224043200000)/"}]}', 0, 0)
INSERT INTO [AmorCanino].[dbo].[Communication] (OriginatorID, TargetID,TextMessage, ReadedByOriginator, ReadedByTarget) VALUES (1,3,'{"Messages":[{"Message":"Prueba de mensaje", "UserId":"1", "PublishedDate":"/Date(1224043200000)/"}, {"Message":"Respuesta", "UserId":"2", "PublishedDate":"/Date(1224043200000)/"}]}', 0, 1)
GO																				  
												
/*RACE TABLE DATA*/
Set Identity_Insert [AmorCanino].[dbo].[Races] On
INSERT INTO [AmorCanino].[dbo].[Races] ([RaceId],[RaceName],[Visible]) VALUES (1,'Ninguna',1)
INSERT INTO [AmorCanino].[dbo].[Races] ([RaceId],[RaceName],[Visible]) VALUES (2,'Golden Retriever',1)
INSERT INTO [AmorCanino].[dbo].[Races] ([RaceId],[RaceName],[Visible]) VALUES (3,'Rottweiler',1)
Set Identity_Insert [AmorCanino].[dbo].[Races] Off
GO

/*ANIMAL TABLE DATA*/
Set Identity_Insert [AmorCanino].[dbo].[Animals] On
INSERT INTO [AmorCanino].[dbo].[Animals] ([AnimalId],[UserId],[RaceId],[Name],[BirthDate],[Sex],WithPapers,Vaxins,Discapacities,[IsForAdoption],[IsForMate],[Visible]) VALUES (1,2,3,'Pedrito','20110606',1,1,0,'',1,1,1)
INSERT INTO [AmorCanino].[dbo].[Animals] ([AnimalId],[UserId],[RaceId],[Name],[BirthDate],[Sex],WithPapers,Vaxins,Discapacities,[IsForAdoption],[IsForMate],[Visible]) VALUES (2,2,2,'Juancito',GETDATE(),0,1,0,'',0,1,1)
INSERT INTO [AmorCanino].[dbo].[Animals] ([AnimalId],[UserId],[RaceId],[Name],[BirthDate],[Sex],WithPapers,Vaxins,Discapacities,[IsForAdoption],[IsForMate],[Visible]) VALUES (3,2,2,'Chiquito',GETDATE(),1,1,0,'',1,0,1)
Set Identity_Insert [AmorCanino].[dbo].[Animals] Off
GO

/*RELATED PICTURES TABLE DATA*/
INSERT INTO [AmorCanino].[dbo].PetRelatedPictures (PictureID, AnimalId) VALUES ('8FE2BC7B-4D2E-415A-B7B5-A54B766F59D9',1)
INSERT INTO [AmorCanino].[dbo].PetRelatedPictures (PictureID, AnimalId) VALUES ('8FE2BC7B-4D2E-415A-B7B5-A54B766F59D8',1)
GO

/*CATEGORY TABLE DATA*/
Set Identity_Insert [AmorCanino].[dbo].[ProductCategories] On
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (1,0,'Comida para perros',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (2,1,'Dogui',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (3,1,'Kongo',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (4,1,'Premium',0)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (5,0,'Ropa',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (6,0,'Camas',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (7,0,'Galletas y premios',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (8,0,'Bowls',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (9,0,'Jaulas',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (10,0,'Artículos de peluqiería',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (11,0,'Juguetes',1)
INSERT INTO [AmorCanino].[dbo].[ProductCategories] (CategoryId,ParentCategoryId,CategoryDescription,[Visible]) VALUES (12,0,'Vitaminas y suplementos',1)
Set Identity_Insert [AmorCanino].[dbo].[ProductCategories] Off
GO

/*PRODUCTS TABLE DATA*/
Set Identity_Insert [AmorCanino].[dbo].[Products] On
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (1,2,'Collar grande','Un collar muy grande',null,100,2,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (2,2,'Collar muy grande en su nombre','Un collar muy muy grande',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (3,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (4,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (5,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (6,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (7,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (8,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (9,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (10,3,'Collar chico','Un collar chiquito',null,200,5,0,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (11,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (12,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (13,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (14,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (15,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (16,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
INSERT INTO [AmorCanino].[dbo].[Products] (ProductId,CategoryId,Name,SmallDescription,Picture,Price,Quantity,Remarked,Visible) VALUES (17,3,'Collar chico','Un collar chiquito',null,200,5,1,1)
Set Identity_Insert [AmorCanino].[dbo].[Products] Off
GO

ALTER TABLE [dbo].[Products] WITH CHECK ADD CONSTRAINT [FK_Product_Category] FOREIGN KEY([CategoryId]) REFERENCES [dbo].[ProductCategories] ([CategoryId])
GO
ALTER TABLE [dbo].[Products] CHECK CONSTRAINT [FK_Product_Category]
GO

ALTER TABLE [dbo].[Profile] WITH CHECK ADD CONSTRAINT [FK_Profile_Users] FOREIGN KEY([UserId]) REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[Profile] CHECK CONSTRAINT [FK_Profile_Users]
GO

ALTER TABLE [dbo].[Animals] WITH CHECK ADD CONSTRAINT [FK_Animals_Users] FOREIGN KEY([UserId]) REFERENCES [dbo].[Users] ([UserId])
GO
ALTER TABLE [dbo].[Animals] CHECK CONSTRAINT [FK_Animals_Users]
GO

ALTER TABLE [dbo].PetRelatedPictures WITH CHECK ADD CONSTRAINT [FK_Related_Pictures] FOREIGN KEY(AnimalId) REFERENCES [dbo].[Animals] ([AnimalId])
GO
ALTER TABLE [dbo].PetRelatedPictures CHECK CONSTRAINT [FK_Related_Pictures]
GO

ALTER TABLE [dbo].[Animals] WITH CHECK ADD CONSTRAINT [FK_Animals_Races] FOREIGN KEY([RaceId]) REFERENCES [dbo].[Races] ([RaceId])
GO
ALTER TABLE [dbo].[Animals] CHECK CONSTRAINT [FK_Animals_Races]
GO